// components/DataItem/indexNew.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    name: String,
    idx: {
      type: Number,
      value: 1
    },
    oxtaId : {
      type : Number,
      value : 0
    },
    normalSum: {
      type: Number,
      value: 0
    },
    errorSum: {
      type: Number,
      value: 0
    },
    warnSum: {
      type: Number,
      value: 0
    },
    obj: {
      type: Object,
      value: {}
    },
    showAnalysis: {
      type: Boolean,
      value: false
    },
    showDataDetail : {
      type: Boolean,
      value: false
    },
    forwardAnalysisAction : { //0不跳转，1跳转
      type: Number,
      value: 0
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    showMore: true
  },

  /**
   * 组件的方法列表
   */
  methods: {
    toggleShow() {
      const { showMore } = this.data
      this.setData({
        showMore: !showMore
      })
    },
    toPageAnalysis(event) {
      console.log(event.currentTarget.dataset.areaid);
      var areaId = event.currentTarget.dataset.areaid|| 0;
      var activetype = event.currentTarget.dataset.activetype || '';
      var isforwordanalysis = event.currentTarget.dataset.isforwordanalysis || 0;
      console.log(areaId);
      if (isforwordanalysis == 0) {
        return false;
      } else if (isforwordanalysis == 1) {
        wx.navigateTo({
          url: '/pages/spray/analysis?areaId=' + areaId + '&activeType=wendu',
        })
      }
    }
  }
})
